package cn.com.dbappsecurity.frame.datamodal;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import lombok.Data;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
 * TREE组件数据模型
 * @author dhz
 */
public class TreeDataModal extends JsonDataModal{

	public TreeDataModal(){
		super(true);
		super.putObj("data",new ArrayList<MenuItem>());
	}
	
	public TreeDataModal(List<MenuItem> data){
		super(true);
		super.putObj("data",data == null ? new ArrayList<MenuItem>() : data);
	}
	
	/**
	 * 节点项
	 * @author dhz
	 */
	@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
	@Data
	public static class MenuItem{
		private Integer id;
		private String text;
		private String state;
		private String iconCls;
		private Boolean checked;
		private Map<Object,Object> attributes;
		private List<MenuItem> children;
	}
	
}
